<template>
  <view class="header">
    <view class="back-arrow" @click="onBack" />
    <text class="title">
      {{ title }}
    </text>
    <view class="collection-text" @click="handleSubmit">
      <text>提交</text>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: '赊欠录入',
    },
    onBack: {
      type: Function,
      default: () => {},
    },
    handleSubmit: {
      type: Function,
      default: () => {},
    },
  },
};
</script>

<style scoped>
.header {
  position: relative;
  display: flex;
  align-items: center;
  height: 88rpx;
  padding: 0 20rpx;
  border-bottom: 1rpx solid #f5f5f5;
  background-color: #fff;
}

.back-arrow {
  position: absolute;
  left: 20rpx;
  width: 30rpx;
  height: 30rpx;
  background: url("@/static/images/order/back.png") no-repeat center;
  background-size: contain;
}

.title {
  font-size: 36rpx;
  color: #000;
  font-weight: bold;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.collection-text {
  position: absolute;
  right: 20rpx;
  font-size: 36rpx;
  color: rgba(255, 87, 51, 1);
  display: flex;
  font-weight: bold;
  align-items: center;
}
</style>
